//
//  ZSY_BaseViewController.m
//  zsy_BreadTrip
//
//  Created by dllo on 15/12/28.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ZSY_BaseViewController.h"

@interface ZSY_BaseViewController ()

@end

@implementation ZSY_BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    
    self.view.backgroundColor = WHITE_COLOR;
    
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    
    NSString *states = [[NSUserDefaults standardUserDefaults] objectForKey:@"night"];
    
    if ([states isEqualToString:@"yes"]) {
        //黑夜状态
        self.view.backgroundColor = NIGHT_COLOR;
    }
    
}

-(void)changeColor:(NSNotification *)notification{
    
    UIColor *color = [notification object];
    self.view.backgroundColor = color;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
